#include <bits/stdc++.h>
using namespace std;
class ListNode{
public:
	int* data;
	ListNode* next;
};


class Test{
public:
	ListNode* removeNthFromEnd(ListNode* head, int n){
		ListNode* dummyHead = new ListNode;
		dummyHead->next = head;
		ListNode* slow = dummyHead;
		ListNode* fast = dummyHead;
		int cnt = n;
		while(fast && cnt--){
			fast = fast->next;
		}
		if(cnt!=0){
			return NULL;
		}
		while(fast != NULL){
			fast = fast->next;
			slow = slow->next;
		}
		ListNode* delNode = slow->next;
		slow->next = delNode->next;
		delete delNode;
		delNode = NULL;
		return dummyHead->next;
	}
	
};


int main(){
	
	
	return 0;
}
